<template>
  <div class="home">

    <input type="text" v-model="text">
    <button @click="tijiao">提交</button>
    <p>{{school.mes}}</p>
  </div>
</template>

<script>

export default {
  name: "Home",
  data() {
    return {
      text: '',
      school:[]
    };
  },
  components: {
  },
  methods: {
    tijiao(){
      console.log(localStorage.user==undefined);
      this.ajax({
        method:"post",
        url:'/queryLogin',
        data:{
          name:this.text
        }
      }).then(res=>{
        console.log(res);
        this.school=res.data
      }).catch(res=>{
        this.school=res.data
      })
    }
  },
  mounted () {
    console.log(localStorage.user);
  }
};
</script>
